﻿@using AtletIS.Shared.Helpers
@model MvcAtletIS.Models.LiveModel
@if (Model.Top3 != null && Model.Top3.Count > 0)
{
    int rank = 1;
             
    <ul>
    
    @foreach (var item in Model.Top3)
    { 
        <li class="main-info-small">
                        
            <!-- Rank -->
            <div class="order-box-small">@rank</div>

            <img class="picture-box-small" src="@Url.Content("~/Content/flags/24px/" + item.CountryId + ".png")" alt="@item.CountryId" height="18px" />
                        
            <!-- StartNumber -->
            @if (item.StartNumber != 0)
            {
                <div class="lane-box-small">(@item.StartNumber)</div>
            }
            else
            {
                <div class="lane-box-small">&zwnj;</div>
            }

            <div class="name-box-small">@item.Surname.ToUpper() @item.FirstName</div>

            <!-- Result -->
            <div class="result-box-small">@PrintHelper.PrintResult(TimeSpanHelper.ToResultString(item.ChipDateTimeSpan), Model.ActiveDiscipline.DisciplineCode.Value)</div>
                        
        </li>
                    
            rank += 1;
    }
    </ul>
}

@if (Model.Last != null && Model.Last.Count > 0)
{
    <p>ACTUAL</p>
    <ul>
    
    @foreach (var item in Model.Last)
    { 
        <li class="main-info-small">
                        
            <!-- Rank -->
            <div class="order-box-small">@item.Rank</div>

            <img class="picture-box-small" src="@Url.Content("~/Content/flags/24px/" + item.CountryId + ".png")" alt="@item.CountryId" height="18px" />
                        
            <!-- StartNumber -->
            @if (item.StartNumber != 0)
            {
                <div class="lane-box-small">(@item.StartNumber)</div>
            }
            else
            {
                <div class="lane-box-small">&zwnj;</div>
            }

            <div class="name-box-small">@item.Surname.ToUpper() @item.FirstName</div>

            <!-- Result -->
            <div class="result-box-small">@PrintHelper.PrintResult(TimeSpanHelper.ToResultString(item.ChipDateTimeSpan), Model.ActiveDiscipline.DisciplineCode.Value)</div>
                        
        </li>
    }
    </ul>
    <p class="refresh-info">
        @ViewRes.SharedStrings.Refreshed: @ViewBag.Refreshed
    </p>
}

